﻿/// <reference path="../GeneratedArtifacts/viewModel.js" />

myapp.AddEditStudent.Delete_execute = function (screen) {
    screen.Student.deleteEntity();
    // Save changes
    myapp.commitChanges().then(null, function fail(e) {
        // If error occurs, show the error.
        msls.showMessageBox(e.message, { title: e.title }).then(function () {
            // Cancel Changes
            myapp.cancelChanges();
            throw e;
        });
    });
};